﻿<CustomControls1:TaskbarNotifier x:Class="TraceView.UI.CustomControls.TraceItemToastControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                                 xmlns:CustomControls1="clr-namespace:TraceView.UI.CustomControls"
                                 xmlns:UI1="clr-namespace:TraceView.UI"
                                 mc:Ignorable="d" 
             Margin="10"
             Background="Transparent"
             AllowsTransparency="True"           
             x:Name="Toast" Width="380" Height="130">
    <Grid DataContext="{Binding ElementName=Toast}" Width="360" Height="110" Margin="10">
        <Border Background="{StaticResource ToastBackground}" 
                CornerRadius="5"
                BorderBrush="{Binding TraceItem.Severity, Converter={UI1:SeverityToSelectedItemBrushConverter}}"
                BorderThickness="1">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>   
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions> 
                <StackPanel Orientation="Horizontal"
                            Grid.ColumnSpan="2">
                    <Image Width="16"
                           Height="16"
                           Source="{StaticResource TrayIcon}"/>
                    <StackPanel Orientation="Horizontal"                                                        
                                Margin="5,0,5,0"
                                VerticalAlignment="Top" 
                                HorizontalAlignment="Left">
                        <TextBlock Text="trace"
                               Margin="0"
                               Padding="0"                       
                               Foreground="DarkGray"  
                               FontWeight="UltraLight"                   
                               FontSize="14"/>
                        <TextBlock Text="view"
                               Margin="0"
                               Padding="0"                                                   
                               Foreground="{StaticResource brandBrush}"
                               FontWeight="Thin"                   
                               FontSize="14"/>
                    </StackPanel>
                </StackPanel>
                <Image Source="{StaticResource ErrorToast}" 
                       Grid.RowSpan="3"
                       Width="36"
                       Height="36"
                       VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Margin="5"/>  
                <TextBlock TextWrapping="WrapWithOverflow"
                           Text="{Binding ToastMessage}"
                           FontWeight="Regular"
                           Grid.Row="1"
                           Grid.Column="1"
                           MouseEnter="ToastMouseEnter"
                           MouseDown="TextBlockMouseDown"
                           VerticalAlignment="Center"
                           Foreground="{StaticResource MetroWhite}"
                           FontSize="14"/>
                <TextBlock FontWeight="Thin"
                                   FontSize="11"
                                   Grid.Row="2"
                                   Grid.ColumnSpan="2"
                                   VerticalAlignment="Bottom"
                                   HorizontalAlignment="Left"                           
                                   Margin="10,5,5,0"                              
                                   Foreground="{StaticResource MetroWhite}">
                        <Run Text="{Binding TraceItem.TimeStamp, StringFormat='{}{0:t}'}"/>
                        <Run Text="via"/>
                        <Run Text="{Binding TraceItem.Source}"/>
                        <Run Text="("/>
                        <Run Text="{Binding TraceItem.UserName}"/>
                        <Run Text=")"/>
                </TextBlock>
                <Button HorizontalAlignment="Right"
                        Margin="5"
                        Grid.Column="2"
                        VerticalAlignment="Top"
                        ToolTip="Close"
                        Style="{StaticResource ChromeButtonStyle}"
                        Click="OnCloseClick">
                    <TextBlock TextWrapping="Wrap"
                               Text="r"
                               FontFamily="Webdings"
                               Foreground="#FF919191"
                               FontSize="13.333" />
                </Button>
                
            </Grid>
            
        </Border>
    </Grid>
</CustomControls1:TaskbarNotifier>
